<?php
/**
 * 类名称
 * User: 13651
 * Time: 2025/9/26 10:33
 */

namespace App\Repository;

use App\Models\StorePayWay;
use App\Repository\CommonRepo;
use Illuminate\Database\Eloquent\Builder;

class StorePayRepo extends CommonRepo
{

    /**
     * 更新商户支付渠道开通信息
     * @param array $where
     * @param array $data
     * @return int
     */
    public function savaData(array $where,array $data)
    {
        return StorePayWay::query()->where($where)->update($data);
    }

    /**
     * 根据商户编码获取信息
     * @param string $storeId
     * @param string $company
     * @return Builder[]|\Illuminate\Database\Eloquent\Collection
     */
    public function getByStoreIdStatusInfo(string $storeId,string $company)
    {
        return StorePayWay::query()->where('store_id',$storeId)->where("company",$company )->where('status',1)->get();
    }
}